Read time: about 5min
Here we will have some interaction and enjoy beautiful graphs and charts. Due to the dataset structure, there are many types of graphs and charts are unavailable, so I tried my best to show you as more as analytic methods so that you could have a clear understanding of this dataset.
Here is the graph for you to adventure. Click on each bar and you can have a look at a certain number of population.
install.packages("tidyverse")
## Error in install.packages : Updating loaded packages
library(tidyverse)
library(highcharter)
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
## Highcharts (www.highcharts.com) is a Highsoft software product which is
## not free for commercial and Governmental use
usdataset=read_csv("/Users/zhanwei/Downloads/comm2501. r/COMM2501 Blog/US Population Estimates.csv")
## Parsed with column specification:
## cols(
## .default = col_double(),
## Sex = col_character(),
## Origin = col_character(),
## Race = col_character()
## )
## See spec(...) for full column specifications.
usdataset %>% group_by(Race) %>% mutate(usdataset_mean=mean(`Age 20`)) %>% hchart(type="bar", hcaes(x=Race, y=usdataset_mean))
It is pron to know that there are few AIAN,Asian and Two or More Races population at age 20, while the White race has the biggest part of population, which has around 2000k.
Move your mouse to the category to find more details.
usdataset %>% group_by(Race) %>% mutate(usdataset_mean=mean(`Age 50`)) %>% ungroup() %>% hchart(type="column", hcaes(x=Race,y=`Age 50`, group=Origin))
As the graph told us, the White race has the biggest population that is not Hispanic.